/*
 * @Description: 
 * @Author: iamsmiling
 * @Date: 2021-06-08 08:39:05
 * @LastEditTime: 2021-06-09 14:44:56
 */
import 'dart:convert';

import 'package:azlistview/azlistview.dart';

class CityGrounpEntity extends ISuspensionBean {
  late String tag;
  late List<CityEntity> list;

  CityGrounpEntity({required this.tag, required this.list});

  @override
  String getSuspensionTag() => tag;

  @override
  String toString() => json.encode(this);

  Map<String, dynamic> toJson() => {
        'name': tag,
//        'tagIndex': tagIndex,
//        'namePinyin': namePinyin,
//        'isShowSuspension': isShowSuspension
      };
}

class CityEntity {
  late String name;
  late int id;

  CityEntity({required this.name, this.id = -1});
}

class CityModel extends ISuspensionBean {
  String name;
  String? tagIndex;
  String? namePinyin;

  CityModel({
    required this.name,
    this.tagIndex,
    this.namePinyin,
  });

  CityModel.fromJson(Map<String, dynamic> json) : name = json['name'];

  Map<String, dynamic> toJson() => {
        'name': name,
//        'tagIndex': tagIndex,
//        'namePinyin': namePinyin,
//        'isShowSuspension': isShowSuspension
      };

  @override
  String getSuspensionTag() => tagIndex!;

  @override
  String toString() => json.encode(this);
}
